﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BSCMFF.Core.DataAccessLayer;
using Telerik.Web.UI;

namespace BSCMFF.Web.UserControls.EmployeeTabs
{
    public partial class TrainingTab : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            BSCEntities context = new BSCEntities();

            var trainings = (from t in context.Trainings
                             select t);

            RadGrid1.DataSource = trainings;
            RadGrid1.DataBind();

            //var data = (from t in context.Trainings
            //            select t).Single();

            //Training tr = (Training)data;
            //Label8.Text = tr.Status;
            //Label8.DataBind();
        }

        protected void RadGrid1_SelectedIndexChanged(object sender, EventArgs e)
        {
            string s = sender.GetType().ToString();
            GridDataItem dataItem = RadGrid1.SelectedItems[0] as GridDataItem;

            LabelEval.Text =((Training)dataItem.DataItem).Name;
        }
    }
}